package com.raven.play.datalink.common.type;

import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors
public abstract class SimpleField {

    /**
     * 名称
     */
    private String name;
    /**
     * 类型
     */
    private TypeEnum type;
    /**
     * 描述
     */
    private String doc;
    /**
     * 默认值
     */
    private Object defaultValue;
    /**
     * 是否允许为空
     */
    private boolean nullable;

    public SimpleField(String name, TypeEnum type) {
        this(name, type, null, null, true);
    }

    public SimpleField(String name, TypeEnum type, String doc, Object defaultValue, boolean nullable) {
        this.name = name;
        this.type = type;
        this.doc = doc;
        this.defaultValue = defaultValue;
        this.nullable = nullable;
    }
}
